import React, { Component } from 'react';
import { connect } from 'react-redux';
import { RecommendList, RecommendItem } from '../style'

class Recommend extends Component{
  render() {
    const { RecommendImg } = this.props
    const JSRecommendImg = RecommendImg.toJS()
    return (
      <RecommendList>
        {
          JSRecommendImg.map((item) => {
            return (
              <RecommendItem imgUrl={item.imgUrl} key={item.id}></RecommendItem>
            )
          })
        }
      </RecommendList>
    )
  }
}

const mapState = (state) => {
  return {
    RecommendImg: state.getIn(['home','RecommendImg']),
  }
}

export default connect(mapState, null)(Recommend);


